<template>
  <div id="app">
    <!-- <img src="./assets/logo.png"> -->
    <Left v-if="tabType"></Left>
    <router-view v-if="isRouterAlive"/>
  </div>
</template>

<script>
  import Left from '@/views/Left'
  export default {
    name: 'App',
    components: {Left},
    provide(){
      return{
        reload: this.reload
      }
    },
    data(){
      return{
        isRouterAlive :true,
        tabType:true
      }
    },
    methods:{
      reload(){
        this.isRouterAlive =false
        this.$nextTick(function () {
          this.isRouterAlive=true
        })
      }
    },
    //监视路由路径,如果路由跳转的路径是登录和注册页面，则不显示底部导航栏
    watch:{
      $route(e){
        if (e.name==='MerchantLogin'||e.name==='MerchantRegister'){
          window.reload();//重新加载页面
          this.tabType=false
        }else {
          this.tabType=true
        }
      }
    }
  }
</script>

<style scoped>
  #app {
    font-family: 'Avenir', Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-align: center;
    color: #2c3e50;
    /* margin-top: 60px; */
  }
  body{
    margin:0;
    padding:0;
    border:0
  }
</style>
